//
//  Detail_LineBtn.m
//  TY-C
//
//  Created by xyyl on 2024/3/12.
//

#import "Detail_LineBtn.h"
#import "ComonFile.h"

@implementation Detail_LineBtn
// 70 * 2  21 *2
-(instancetype)initWithFrame:(CGRect)frame {
    if (self == [super initWithFrame:frame]) {
        [self initViews];
        [self initFrames];
        _nameLab.userInteractionEnabled = NO;
        _lineLab.userInteractionEnabled = NO;
    }
    return self;
}

- (void)initFrames {

    [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.centerX.equalTo(self.mas_centerX);
        make.height.equalTo(@(18*IPADSCALE));
    }];
    
    _nameLab.textColor = RGBColor(10, 125, 175);
//    _nameLab.textColor = RGBColor(153, 153, 153);

    [_lineLab mas_makeConstraints:^(MASConstraintMaker *make) {
    
        make.height.equalTo(@(1.5*IPADSCALE));
        make.left.right.equalTo(self);
        make.bottom.equalTo(self.mas_bottom);
    }];
    _lineLab.backgroundColor = RGBColor(10, 125, 175);
//    _lineLab.backgroundColor = RGBColor(153, 153, 153);

    
    
}
- (void)initViews {
    _nameLab = [UILabel new];
    _lineLab = [UILabel new];
    [self addSubview:_nameLab];
    [self addSubview:_lineLab];
}


- (void)setSelected:(BOOL)selected {
    if(selected == YES){
        _lineLab.backgroundColor = RGBColor(10, 125, 175);
        _nameLab.textColor = RGBColor(10, 125, 175);

    }else{
        _lineLab.backgroundColor = RGBColor(237, 237, 237);

        _nameLab.textColor = RGBColor(153, 153, 153);

    }
}

@end
